Skip to content

common: add @ethdebug/common (Raw, Machine, keccak256) - #413

Merged
gnidan merged 10 commits into
mainfrom
common-package
Nov 19, 2026
Merged

gnidan merged 10 commits into
mainfrom
common-package

Conversation

@gnidan

@gnidan gnidan commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

This adds a new package, packages/common (@ethdebug/common), for runtime code that the ethdebug packages share. The codec needs pointers' low-level byte and machine code without pulling in pointers' dereference logic, and @ethdebug/format stays types and guards only, so that code moves here.

@ethdebug/common has:

  • Raw, which replaces the Data class from @ethdebug/pointers. A Raw is a plain Uint8Array; the old methods are now functions in the Raw namespace with the same names and behavior (Raw.toHex(raw), Raw.asUint(raw), Raw.fromHex(hex), Raw.resizeTo(raw, n), and so on). Data.fromBytes is gone, because any Uint8Array is a Raw. Raw.concat copies the bytes directly instead of going through hex strings; the output is the same.
  • The Machine interfaces, moved from @ethdebug/pointers, with every Data now Raw.
  • keccak256(raw), which pointers' evaluate and the evm executor now use.

Every package now uses these from @ethdebug/common. Nothing of Data is left.

Breaking changes

  • @ethdebug/pointers no longer exports Data or Machine, and does not re-export them. Import Raw and Machine from @ethdebug/common, and replace data.toHex() with Raw.toHex(data) (and so on for the other methods).
  • @ethdebug/evm's machine reads give Raw values.
  • @ethdebug/pointers-react no longer re-exports any types: not Data and Machine from @ethdebug/pointers, and not Pointer from @ethdebug/format or Cursor from @ethdebug/pointers (pointers-react: drop the Pointer and Cursor re-exports #415). Import each from the package that defines it.

Docs and schemas

The "Data and machines" page in the pointers implementation guide keeps its URL, is now titled "Raw bytes and machines", and lists the code from @ethdebug/common. The other pages that named Data now name Raw. The fixed-point type schemas now say "unscaled value" where they said "raw value", so that "raw" means bytes only.

Release note

npm trusted publishing needs a package to exist on the registry before it can be configured. The first publish of @ethdebug/common must be done by hand, and the trusted publisher added on npmjs.com afterward, before the release workflow can publish it.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
Preview removed because the pull request was closed.
2026-11-19 23:08 UTC

@gnidan
gnidan marked this pull request as ready for review November 16, 2026 22:36
# Conflicts:
#	packages/pointers/CHANGELOG.md
#	packages/pointers/src/dereference/region.ts
#	schemas/type/elementary/fixed.schema.yaml
#	schemas/type/elementary/ufixed.schema.yaml
evm no longer imports @ethdebug/pointers, and pointers uses
ethereum-cryptography only in a test. RELEASING.md now counts common.
@gnidan
gnidan merged commit f70f45f into main Nov 19, 2026
9 checks passed
@gnidan
gnidan deleted the common-package branch November 19, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant